<?php
/**
 * Project: AIGC
 * Author: moufer <moufer@163.com>
 * Date: 2024/7/20 12:23
 */

namespace module\chat\model;

use mof\Model;
use think\model\relation\BelongsTo;

/**
 * 助手模型
 * @property Category $category 所属分类
 */
class Assistant extends Role
{
    protected $globalScope = ['type'];

    protected $scene = [
        'detail' => [
            'visible' => [
                'category_id', 'welcome', 'questions', 'placeholder', 'icon', 'id', 'intro', 'name',
                'type', 'used_ct', 'favor_ct',
            ]
        ]
    ];

    public function scopeType($query): void
    {
        $query->where('type', 'assistant');
    }

    public function sourceType(): string
    {
        return 'chat:assistant';
    }

}